package com.wwj.study.singleton.register;

import java.util.HashMap;

/**
 * Created by lenovo on 2018/11/15.
 */
public class Register {

    private static HashMap<String,Object> map=new HashMap<String, Object>();

    public static Object getInstance(String name){
        if(name==null){
            return null;
        }

        if(map.get(name)==null){
            map.put(name,new Register());
        }
        return map.get(name);
    }
}
